#include <stdio.h>
#include <stdlib.h>
#define TYPE char
typedef struct tree_node{
	TYPE data;
	struct tree_node *left, *right;
}Tree;
Tree * new_tree(){
	Tree * p = (Tree *)malloc(sizeof(Tree));
	printf("Input the data:");
	scanf("%c",&(p->data));
	printf("\n");
	if (p->data == '#'){
		p->left = NULL;
		p->right = NULL;
		return p;
	}else{
		p->left = new_tree();
		p->right= new_tree();
	}
	return p;
}
Tree * new_node(TYPE * data, Tree *l, Tree *r){
	Tree * p = (Tree *)malloc(sizeof(Tree));
	p->left = l;
	p->right = r;
	p->data = *data;
	return p;
}
void postorder(Tree * root){
	if (!root) return;
	postorder(root->left);
	postorder(root->right);
	printf("%c",root->data);
}
void preorder(Tree * root){
	if (!root) return;
	printf("%c",root->data);
	postorder(root->left);
	postorder(root->right);
}
void inorder(Tree * root){
	if (!root) return;
	postorder(root->left);
	printf("%c",root->data);
	postorder(root->right);
}


int main(int argc, char **argv){
	Tree *root = new_tree();
	postorder(root);
	return 0;
}
